<template>
    <div>
        <div class="query">
            <kv label="appCode">
                <el-input v-model.lazy="$data.value"/>
            </kv>
            <kv label="已存在">
                <selector :url="$data.appsUrl" @change="v=>$data.value=v"></selector>
            </kv>
            <kv>
                <el-button @click="open_click">打开菜单管理</el-button>
            </kv>
        </div>
        <menu-list :app-code="$data.appCode" :key="$data.version" v-if="$data.appCode"></menu-list>
    </div>
</template>

<script setup>
/**
 * Created by CodeGenerator at 2021-03-14 15:58:11
 */
import menuList from "./app-menu-list.vue"






//定义 vue2的this,当前组件
const $self = getCurrentInstance();

//定义 $attrs
const $attrs = useAttrs();



//定义data
const $data = reactive({
    appsUrl:"/sys/app-menu/list-saved-app",
    value: "",
    appCode: "",
    version: 0
});


const $props = defineProps({

});


const list = ref();

//定义事件
const $emit = defineEmits(["update:modelValue","loaded"]);



const open_click = function() {
    $data.appCode = $data.value;
    $data.version++
    localStorage.setJson("value", $data.value)
};

onMounted( function() {
    var store = localStorage.getJson()
    if (store) {
        $data.value = store.value;
    }
} )

</script>

